From: Jim Blandy Date: Mon, 24 May 1993 15:04:07 +0000 (+0000) Subject: * xterm.c (x_new_font): Reject fonts with varying spacing. We X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~96044 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=9696f58be781597a4ac17ff6051fdba4da0200f6;p=emacs.git * xterm.c (x_new_font): Reject fonts with varying spacing. We don't support them yet. * xfns.c (x_set_font): Report the error message properly. --- diff --git a/src/xterm.c b/src/xterm.c index 8ea6bdd3fbe..9d85e1c9d28 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3877,6 +3877,7 @@ x_new_font (f, fontname) font_names = (char **) XListFontsWithInfo (x_current_display, fontname, 1024, &n_matching_fonts, &font_info); + /* If the server couldn't find any fonts whose named matched fontname, return an error code. */ if (n_matching_fonts == 0) @@ -3904,8 +3905,19 @@ x_new_font (f, fontname) /* Otherwise, load the font and add it to the table. */ else { + int i; XFontStruct *font; + /* Try to find a character-cell font in the list. */ + for (i = 0; i < n_matching_fonts; i++) + if (! font_info[i].per_char) + break; + + if (i >= n_matching_fonts) + return 2; + else + fontname = font_names[i]; + font = (XFontStruct *) XLoadQueryFont (x_current_display, fontname); if (! font) return 1;